Optimal. Leaf size=191 \[ -\frac {B (b c-a d) n}{2 (b g-a h) (d g-c h) (g+h x)}+\frac {b^2 B n \log (a+b x)}{2 h (b g-a h)^2}-\frac {B d^2 n \log (c+d x)}{2 h (d g-c h)^2}-\frac {A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{2 h (g+h x)^2}+\frac {B (b c-a d) (2 b d g-b c h-a d h) n \log (g+h x)}{2 (b g-a h)^2 (d g-c h)^2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.15, antiderivative size = 191, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.065, Rules used = {2548, 84}
\begin {gather*} -\frac {B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A}{2 h (g+h x)^2}+\frac {b^2 B n \log (a+b x)}{2 h (b g-a h)^2}-\frac {B n (b c-a d)}{2 (g+h x) (b g-a h) (d g-c h)}+\frac {B n (b c-a d) \log (g+h x) (-a d h-b c h+2 b d g)}{2 (b g-a h)^2 (d g-c h)^2}-\frac {B d^2 n \log (c+d x)}{2 h (d g-c h)^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 84
Rule 2548
Rubi steps
\begin {align*} \int \frac {A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{(g+h x)^3} \, dx &=\int \left (\frac {A}{(g+h x)^3}+\frac {B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{(g+h x)^3}\right ) \, dx\\ &=-\frac {A}{2 h (g+h x)^2}+B \int \frac {\log \left (e (a+b x)^n (c+d x)^{-n}\right )}{(g+h x)^3} \, dx\\ &=-\frac {A}{2 h (g+h x)^2}-\frac {B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{2 h (g+h x)^2}+\frac {(B (b c-a d) n) \int \frac {1}{(a+b x) (c+d x) (g+h x)^2} \, dx}{2 h}\\ &=-\frac {A}{2 h (g+h x)^2}-\frac {B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{2 h (g+h x)^2}+\frac {(B (b c-a d) n) \int \left (\frac {b^3}{(b c-a d) (b g-a h)^2 (a+b x)}-\frac {d^3}{(b c-a d) (-d g+c h)^2 (c+d x)}+\frac {h^2}{(b g-a h) (d g-c h) (g+h x)^2}-\frac {h^2 (-2 b d g+b c h+a d h)}{(b g-a h)^2 (d g-c h)^2 (g+h x)}\right ) \, dx}{2 h}\\ &=-\frac {A}{2 h (g+h x)^2}-\frac {B (b c-a d) n}{2 (b g-a h) (d g-c h) (g+h x)}+\frac {b^2 B n \log (a+b x)}{2 h (b g-a h)^2}-\frac {B d^2 n \log (c+d x)}{2 h (d g-c h)^2}-\frac {B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{2 h (g+h x)^2}+\frac {B (b c-a d) (2 b d g-b c h-a d h) n \log (g+h x)}{2 (b g-a h)^2 (d g-c h)^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.25, size = 238, normalized size = 1.25 \begin {gather*} \frac {1}{2} \left (\frac {B (-b c+a d) n}{(b g-a h) (d g-c h) (g+h x)}+\frac {b^2 B n \log (a+b x)}{h (b g-a h)^2}-\frac {B n \log (a+b x)}{h (g+h x)^2}-\frac {B d^2 n \log (c+d x)}{h (d g-c h)^2}+\frac {B n \log (c+d x)}{h (g+h x)^2}-\frac {A+B \left (-n \log (a+b x)+n \log (c+d x)+\log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )}{h (g+h x)^2}-\frac {B (b c-a d) (-2 b d g+b c h+a d h) n \log (g+h x)}{(b g-a h)^2 (d g-c h)^2}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains higher order function than in optimal. Order 9 vs. order
3.
time = 0.70, size = 4925, normalized size = 25.79
method | result | size |
risch | \(\text {Expression too large to display}\) | \(4925\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 382 vs.
\(2 (182) = 364\).
time = 0.30, size = 382, normalized size = 2.00 \begin {gather*} \frac {1}{2} \, {\left (\frac {b^{2} n e \log \left (b x + a\right )}{b^{2} g^{2} h - 2 \, a b g h^{2} + a^{2} h^{3}} - \frac {d^{2} n e \log \left (d x + c\right )}{d^{2} g^{2} h - 2 \, c d g h^{2} + c^{2} h^{3}} - \frac {{\left (2 \, a b d^{2} g n - a^{2} d^{2} h n - {\left (2 \, c d g n - c^{2} h n\right )} b^{2}\right )} e \log \left (h x + g\right )}{{\left (d^{2} g^{2} h^{2} - 2 \, c d g h^{3} + c^{2} h^{4}\right )} a^{2} - 2 \, {\left (d^{2} g^{3} h - 2 \, c d g^{2} h^{2} + c^{2} g h^{3}\right )} a b + {\left (d^{2} g^{4} - 2 \, c d g^{3} h + c^{2} g^{2} h^{2}\right )} b^{2}} + \frac {{\left (b c n - a d n\right )} e}{{\left (d g^{2} h - c g h^{2}\right )} a - {\left (d g^{3} - c g^{2} h\right )} b + {\left ({\left (d g h^{2} - c h^{3}\right )} a - {\left (d g^{2} h - c g h^{2}\right )} b\right )} x}\right )} B e^{\left (-1\right )} - \frac {B \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right )}{2 \, {\left (h^{3} x^{2} + 2 \, g h^{2} x + g^{2} h\right )}} - \frac {A}{2 \, {\left (h^{3} x^{2} + 2 \, g h^{2} x + g^{2} h\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 1046 vs.
\(2 (182) = 364\).
time = 45.46, size = 1046, normalized size = 5.48 \begin {gather*} -\frac {{\left (A + B\right )} b^{2} d^{2} g^{4} + {\left (A + B\right )} a^{2} c^{2} h^{4} - 2 \, {\left ({\left (A + B\right )} b^{2} c d + {\left (A + B\right )} a b d^{2}\right )} g^{3} h + {\left ({\left (A + B\right )} b^{2} c^{2} + 4 \, {\left (A + B\right )} a b c d + {\left (A + B\right )} a^{2} d^{2}\right )} g^{2} h^{2} - 2 \, {\left ({\left (A + B\right )} a b c^{2} + {\left (A + B\right )} a^{2} c d\right )} g h^{3} + {\left ({\left (B b^{2} c d - B a b d^{2}\right )} g^{2} h^{2} - {\left (B b^{2} c^{2} - B a^{2} d^{2}\right )} g h^{3} + {\left (B a b c^{2} - B a^{2} c d\right )} h^{4}\right )} n x + {\left ({\left (B b^{2} c d - B a b d^{2}\right )} g^{3} h - {\left (B b^{2} c^{2} - B a^{2} d^{2}\right )} g^{2} h^{2} + {\left (B a b c^{2} - B a^{2} c d\right )} g h^{3}\right )} n - {\left ({\left (B b^{2} d^{2} g^{2} h^{2} - 2 \, B b^{2} c d g h^{3} + B b^{2} c^{2} h^{4}\right )} n x^{2} + 2 \, {\left (B b^{2} d^{2} g^{3} h - 2 \, B b^{2} c d g^{2} h^{2} + B b^{2} c^{2} g h^{3}\right )} n x + {\left (2 \, B a b d^{2} g^{3} h - B a^{2} c^{2} h^{4} - {\left (4 \, B a b c d + B a^{2} d^{2}\right )} g^{2} h^{2} + 2 \, {\left (B a b c^{2} + B a^{2} c d\right )} g h^{3}\right )} n\right )} \log \left (b x + a\right ) + {\left ({\left (B b^{2} d^{2} g^{2} h^{2} - 2 \, B a b d^{2} g h^{3} + B a^{2} d^{2} h^{4}\right )} n x^{2} + 2 \, {\left (B b^{2} d^{2} g^{3} h - 2 \, B a b d^{2} g^{2} h^{2} + B a^{2} d^{2} g h^{3}\right )} n x + {\left (2 \, B b^{2} c d g^{3} h - B a^{2} c^{2} h^{4} - {\left (B b^{2} c^{2} + 4 \, B a b c d\right )} g^{2} h^{2} + 2 \, {\left (B a b c^{2} + B a^{2} c d\right )} g h^{3}\right )} n\right )} \log \left (d x + c\right ) - {\left ({\left (2 \, {\left (B b^{2} c d - B a b d^{2}\right )} g h^{3} - {\left (B b^{2} c^{2} - B a^{2} d^{2}\right )} h^{4}\right )} n x^{2} + 2 \, {\left (2 \, {\left (B b^{2} c d - B a b d^{2}\right )} g^{2} h^{2} - {\left (B b^{2} c^{2} - B a^{2} d^{2}\right )} g h^{3}\right )} n x + {\left (2 \, {\left (B b^{2} c d - B a b d^{2}\right )} g^{3} h - {\left (B b^{2} c^{2} - B a^{2} d^{2}\right )} g^{2} h^{2}\right )} n\right )} \log \left (h x + g\right )}{2 \, {\left (b^{2} d^{2} g^{6} h + a^{2} c^{2} g^{2} h^{5} - 2 \, {\left (b^{2} c d + a b d^{2}\right )} g^{5} h^{2} + {\left (b^{2} c^{2} + 4 \, a b c d + a^{2} d^{2}\right )} g^{4} h^{3} - 2 \, {\left (a b c^{2} + a^{2} c d\right )} g^{3} h^{4} + {\left (b^{2} d^{2} g^{4} h^{3} + a^{2} c^{2} h^{7} - 2 \, {\left (b^{2} c d + a b d^{2}\right )} g^{3} h^{4} + {\left (b^{2} c^{2} + 4 \, a b c d + a^{2} d^{2}\right )} g^{2} h^{5} - 2 \, {\left (a b c^{2} + a^{2} c d\right )} g h^{6}\right )} x^{2} + 2 \, {\left (b^{2} d^{2} g^{5} h^{2} + a^{2} c^{2} g h^{6} - 2 \, {\left (b^{2} c d + a b d^{2}\right )} g^{4} h^{3} + {\left (b^{2} c^{2} + 4 \, a b c d + a^{2} d^{2}\right )} g^{3} h^{4} - 2 \, {\left (a b c^{2} + a^{2} c d\right )} g^{2} h^{5}\right )} x\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 523 vs.
\(2 (182) = 364\).
time = 2.72, size = 523, normalized size = 2.74 \begin {gather*} \frac {B b^{3} n \log \left ({\left | b x + a \right |}\right )}{2 \, {\left (b^{3} g^{2} h - 2 \, a b^{2} g h^{2} + a^{2} b h^{3}\right )}} - \frac {B d^{3} n \log \left ({\left | d x + c \right |}\right )}{2 \, {\left (d^{3} g^{2} h - 2 \, c d^{2} g h^{2} + c^{2} d h^{3}\right )}} - \frac {B n \log \left (b x + a\right )}{2 \, {\left (h^{3} x^{2} + 2 \, g h^{2} x + g^{2} h\right )}} + \frac {B n \log \left (d x + c\right )}{2 \, {\left (h^{3} x^{2} + 2 \, g h^{2} x + g^{2} h\right )}} + \frac {{\left (2 \, B b^{2} c d g n - 2 \, B a b d^{2} g n - B b^{2} c^{2} h n + B a^{2} d^{2} h n\right )} \log \left (h x + g\right )}{2 \, {\left (b^{2} d^{2} g^{4} - 2 \, b^{2} c d g^{3} h - 2 \, a b d^{2} g^{3} h + b^{2} c^{2} g^{2} h^{2} + 4 \, a b c d g^{2} h^{2} + a^{2} d^{2} g^{2} h^{2} - 2 \, a b c^{2} g h^{3} - 2 \, a^{2} c d g h^{3} + a^{2} c^{2} h^{4}\right )}} - \frac {B b c h^{2} n x - B a d h^{2} n x + B b c g h n - B a d g h n + A b d g^{2} + B b d g^{2} - A b c g h - B b c g h - A a d g h - B a d g h + A a c h^{2} + B a c h^{2}}{2 \, {\left (b d g^{2} h^{3} x^{2} - b c g h^{4} x^{2} - a d g h^{4} x^{2} + a c h^{5} x^{2} + 2 \, b d g^{3} h^{2} x - 2 \, b c g^{2} h^{3} x - 2 \, a d g^{2} h^{3} x + 2 \, a c g h^{4} x + b d g^{4} h - b c g^{3} h^{2} - a d g^{3} h^{2} + a c g^{2} h^{3}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 6.35, size = 431, normalized size = 2.26 \begin {gather*} \frac {\ln \left (g+h\,x\right )\,\left (h\,\left (B\,a^2\,d^2\,n-B\,b^2\,c^2\,n\right )-2\,B\,a\,b\,d^2\,g\,n+2\,B\,b^2\,c\,d\,g\,n\right )}{2\,a^2\,c^2\,h^4-4\,a^2\,c\,d\,g\,h^3+2\,a^2\,d^2\,g^2\,h^2-4\,a\,b\,c^2\,g\,h^3+8\,a\,b\,c\,d\,g^2\,h^2-4\,a\,b\,d^2\,g^3\,h+2\,b^2\,c^2\,g^2\,h^2-4\,b^2\,c\,d\,g^3\,h+2\,b^2\,d^2\,g^4}-\frac {\frac {A\,a\,c\,h^2+A\,b\,d\,g^2-A\,a\,d\,g\,h-A\,b\,c\,g\,h-B\,a\,d\,g\,h\,n+B\,b\,c\,g\,h\,n}{a\,c\,h^2+b\,d\,g^2-a\,d\,g\,h-b\,c\,g\,h}-\frac {x\,\left (B\,a\,d\,h^2\,n-B\,b\,c\,h^2\,n\right )}{a\,c\,h^2+b\,d\,g^2-a\,d\,g\,h-b\,c\,g\,h}}{2\,g^2\,h+4\,g\,h^2\,x+2\,h^3\,x^2}-\frac {B\,\ln \left (\frac {e\,{\left (a+b\,x\right )}^n}{{\left (c+d\,x\right )}^n}\right )}{2\,h\,\left (g^2+2\,g\,h\,x+h^2\,x^2\right )}+\frac {B\,b^2\,n\,\ln \left (a+b\,x\right )}{2\,a^2\,h^3-4\,a\,b\,g\,h^2+2\,b^2\,g^2\,h}-\frac {B\,d^2\,n\,\ln \left (c+d\,x\right )}{2\,c^2\,h^3-4\,c\,d\,g\,h^2+2\,d^2\,g^2\,h} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________